Platform Explorer / Nuxeo Platform 2023.22

Contribution org.nuxeo.mail.automation.chains--chains

This contribution is part of XML component org.nuxeo.mail.automation.chains inside nuxeo-platform-mail-2023.22.13.jar /OSGI-INF/automation-contrib.xml

Extension Point

Extension point chains of component OperationServiceComponent.

Registration Order

4
The registration order represents the order in which this contribution was registered on its target extention point. This will impact the override/merge behaviour when it is implemented on the target service, and is useful for proper customization of existing contributions.
You can influence this order by adding "require" tags in the containing component declaration, to make sure it is resolved after another component (see "Resolution Order" on components).

Contributed Items

  • <chain id="CreateMailDocumentFromAutomation">
          <operation id="Context.RestoreDocumentInput">
            <param name="name" type="string">mailFolder</param>
          </operation>
          <operation id="Document.Create">
            <param name="type" type="string">MailMessage</param>
            <param name="name" type="string">expr:Context["mailDocumentName"]</param>
            <param name="properties" type="properties">expr:mail:messageId=@{messageId}
            </param>
          </operation>
          <operation id="Context.SetInputAsVar">
            <param name="name" type="string">mailDocument</param>
          </operation>
          <operation id="Context.RunOperationOnList">
            <param name="id" type="string">ProcessAttachment</param>
            <param name="list" type="string">attachments</param>
            <param name="isolate" type="boolean">true</param>
            <param name="item" type="string">attachment</param>
          </operation>
          <operation id="RunScript">
            <param name="script" type="string">
    
               Context["mailDocument"].setPropertyValue("dc:title",Context["subject"]);
               Context["mailDocument"].setPropertyValue("mail:htmlText",Context["text"]);
               Context["mailDocument"].setPropertyValue("mail:recipients",Context["recipients"]);
               Context["mailDocument"].setPropertyValue("mail:cc_recipients",Context["ccRecipients"]);
               Context["mailDocument"].setPropertyValue("mail:sending_date",Context["sendingDate"]);
    
            </param>
          </operation>
          <operation id="Context.RestoreDocumentInput">
            <param name="name" type="string">mailDocument</param>
          </operation>
          <operation id="Document.Save"/>
        </chain>
  • <chain id="ProcessAttachment">
          <operation id="Context.RestoreBlobInput">
            <param name="name" type="string">attachment</param>
          </operation>
          <operation id="Blob.AttachOnDocument">
            <param name="document" type="document">expr:Context["mailDocument"]</param>
            <param name="save" type="boolean">false</param>
            <param name="xpath" type="string">files:files</param>
          </operation>
        </chain>

XML Source

<extension point="chains" target="org.nuxeo.ecm.core.operation.OperationServiceComponent">
    <chain id="CreateMailDocumentFromAutomation">
      <operation id="Context.RestoreDocumentInput">
        <param name="name" type="string">mailFolder</param>
      </operation>
      <operation id="Document.Create">
        <param name="type" type="string">MailMessage</param>
        <param name="name" type="string">expr:Context["mailDocumentName"]</param>
        <param name="properties" type="properties">expr:mail:messageId=@{messageId}
        </param>
      </operation>
      <operation id="Context.SetInputAsVar">
        <param name="name" type="string">mailDocument</param>
      </operation>
      <operation id="Context.RunOperationOnList">
        <param name="id" type="string">ProcessAttachment</param>
        <param name="list" type="string">attachments</param>
        <param name="isolate" type="boolean">true</param>
        <param name="item" type="string">attachment</param>
      </operation>
      <operation id="RunScript">
        <param name="script" type="string">

           Context["mailDocument"].setPropertyValue("dc:title",Context["subject"]);
           Context["mailDocument"].setPropertyValue("mail:htmlText",Context["text"]);
           Context["mailDocument"].setPropertyValue("mail:recipients",Context["recipients"]);
           Context["mailDocument"].setPropertyValue("mail:cc_recipients",Context["ccRecipients"]);
           Context["mailDocument"].setPropertyValue("mail:sending_date",Context["sendingDate"]);

        </param>
      </operation>
      <operation id="Context.RestoreDocumentInput">
        <param name="name" type="string">mailDocument</param>
      </operation>
      <operation id="Document.Save"/>
    </chain>
    <chain id="ProcessAttachment">
      <operation id="Context.RestoreBlobInput">
        <param name="name" type="string">attachment</param>
      </operation>
      <operation id="Blob.AttachOnDocument">
        <param name="document" type="document">expr:Context["mailDocument"]</param>
        <param name="save" type="boolean">false</param>
        <param name="xpath" type="string">files:files</param>
      </operation>
    </chain>
  </extension>